<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 引入 Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<title>我的维修</title>
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<style>
.item
{
	padding:20px;
	height:180px;
	border-bottom:#000 medium thin
}
</style>
</head>

<body>
<div class="item">
  <div >报修一 </div>
  <div > <span>报修人：张一 </span><span style="margin-left:40px">报修时间：2018/1/1</span><span style="margin-left:40px">报修地址：xxx</span> </div>
  <div> 问题描述：&nbsp;&nbsp;的方式是的嘎嘎嘎 </div>
  <div><span>维修者：张三</span><span style="float:right; margin-right:20px"><input type="button" class="btn active" value="完工" onClick="check()"/></span></div>
  
</div>
<div> </div>
<div> </div>
</body>
<script>
//页面加载函数
$().ready(function()
{
	//获取当前用户的信息
	var user_id=$.cookie("user_id");
	var password=$.cookie("password");
	$.post("/ulms_project/repair",{user_id:user_id,password:password},function(data)
	{
		var str="";
		$(data).each(function()
		{
			str+='<div class="item">'+
 ' <div >'+this.id+' </div>'+
  '<div > <span>报修人：'+this.baoxiuren+' </span><span style="margin-left:40px">报修时间：'+this.time+'</span><span style="margin-left:40px">'+
  '报修地址'+this.address+'</span> </div>'+
  '<div> 问题描述：'+this.describe+' </div>'+
  '<div><span>维修者：'+this.weixiuZhe+'</span><span style="float:right; margin-right:20px">'+
  '<input type="button" class="btn active" value="完工" weixiu_id='+this.id+' onClick="check()"/></span></div>';
		});
		$("body").html(str);
	});
});
//完工函数
function check()
{
	//获取当前维修
	var weixiu_id=$(this).attr("weixiu_id");
	$.post("/ulms_project/repair",{weixiu_id:weixiu_id,status:true},function(data)
	{
		alert("维修成功！！");
	});
}
</script>
</html>
